@import '../common/style/base.less';

@dropdown-menu-height: var(--td-dropdown-menu-height, 96rpx);
@dropdown-menu-bg-color: var(--td-dropdown-menu-bg-color, @bg-color-container);
@dropdown-menu-color: var(--td-dropdown-menu-color, @text-color-primary);
@dropdown-menu-active-color: var(--td-dropdown-menu-active-color, @brand-color);
@dropdown-menu-disabled-color: var(--td-dropdown-menu-disabled-color, @text-color-disabled);
@dropdown-menu-font-size: var(--td-dropdown-menu-font-size, 28rpx);
@dropdown-menu-icon-size: var(--td-dropdown-menu-icon-size, 40rpx);
@dropdown-menu-border-width: var(--td-dropdown-menu-border-width, 1px);

@dropdownMenu: ~'@{prefix}-dropdown-menu';

.@{dropdownMenu} {
  position: relative;
  display: flex;
  height: @dropdown-menu-height;
  background: @dropdown-menu-bg-color;
  .border(bottom);

  &:after {
    height: @dropdown-menu-border-width;
  }

  &__item {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 0 @spacer;
    position: relative;
    overflow: hidden;
    color: @dropdown-menu-color;

    &--active {
      color: @dropdown-menu-active-color;
    }

    &--disabled {
      color: @dropdown-menu-disabled-color;
    }
  }

  &__icon {
    font-size: @dropdown-menu-icon-size;
    padding: 4rpx;
    box-sizing: border-box;
    transition: transform 240ms ease;

    &--active {
      transform: rotate(180deg);
    }

    &:not(:empty) {
      margin-left: 8rpx;
    }
  }

  &__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: @dropdown-menu-font-size;
  }
}
